Method and apparatus for adjusting orientation, and electronic device

ABSTRACT

This application relates to the field of display technologies, and provides a method and an apparatus for adjusting an orientation, and an electronic device. The method comprises: in response to a first rotation operation performed by a user on an electronic device, determining an orientation of content displayed on the screen of the electronic device; after the user performs the first rotation operation on the electronic device, determining whether an orientation of the screen is consistent with the orientation of the content; and in response to that after the user performs the first rotation operation on the electronic device, the orientation of the screen is consistent with the orientation of the content, maintaining the orientation of the content. By using the method, the apparatus, and the electronic device provided in embodiments of the present invention, content displayed on the electronic device can be adjusted to an orientation suitable for a user to view, and the user does not need to perform a specified gesture or enter an edit interface to perform a rotation operation, thereby simplifying a user operation and improving user experience.

TECHNICAL FIELD

This application relates to the field of display technologies, and inparticular, to a method and an apparatus for adjusting an orientation,and an electronic device.

BACKGROUND

As electronic devices are popularized, electronic devices are almostused by people in work, study, and entertainment every day. Electronicdevice manufacturers have always sought to enable users to operateelectronic devices more conveniently and quickly.

For example, many electronic devices are provided with a function ofautomatically rotating a screen. When this function is enabled, if amode in which a user operates an electronic device changes fromlandscape to portrait, as shown in FIG. 1, an interface of anapplication (APP) or an interface of an operating system operated by theuser currently automatically changes from a landscape layout to aportrait layout, to cause that the user performs an operation andcontrol conveniently, and vice versa.

In this case, an orientation of content that is being displayed such asan electronic reading that is being read, Internet content that is beingviewed, or a video that is being watched on the electronic device is notadjusted, still as shown in FIG. 1. As a result, an original orientationis always maintained for the content that is being displayed on theelectronic device, and it cannot be ensured that the orientation ischanged as the electronic device rotates, and that user experience isnot affected.

Therefore, if the original orientation of the content displayed on theelectronic device is abnormal, as shown in FIG. 2, the orientation ofthe displayed content cannot be rectified regardless of how theelectronic device is rotated.

In a traditional operation manner, a user needs to enter an editinterface, and click on and select an option such as “rotate”, to adjustthe orientation of the displayed content, or as shown in FIG. 3, a userneeds to slide on the screen of the electronic device to form aspecified gesture, to correspondingly adjust the orientation.

In the foregoing two operation manners, the former requires a relativelycomplex operation, and moreover, if an APP has no edit function, anorientation cannot be adjusted; the latter requires a user to learn andknow a specified gesture in advance, and moreover, when an electronicdevice is held by using a single hand, it is very difficult to input aspecified gesture.

SUMMARY

An objective of this application is to provide a method and an apparatusfor adjusting an orientation, and an electronic device.

According to a first aspect of at least one embodiment of thisapplication, a method for adjusting an orientation is provided, whereinthe method comprises:

in response to a first rotation operation performed by a user on anelectronic device, determining an orientation of content displayed onthe screen of the electronic device;

after the user performs the first rotation operation on the electronicdevice, determining whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device; and

in response to that after the user performs the first rotation operationon the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintaining theorientation of the content displayed on the screen of the electronicdevice.

According to a second aspect of at least one embodiment of thisapplication, an apparatus for adjusting an orientation is provided,wherein the apparatus comprises:

a first determining module, configured to: in response to a firstrotation operation performed by a user on an electronic device,determine an orientation of content displayed on the screen of theelectronic device;

a second determining module, configured to: after the user performs thefirst rotation operation on the electronic device, determine whether anorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice; and

a first adjustment module, configured to: in response to that after theuser performs the first rotation operation on the electronic device, theorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice, maintain the orientation of the content displayed on the screenof the electronic device.

According to a third aspect of at least one embodiment of thisapplication, an electronic device is provided, wherein the electronicdevice comprises a memory and a processor, the memory is configured tostore an instruction, and the processor is configured to execute theinstruction, to perform the following steps:

in response to a first rotation operation performed by a user on anelectronic device, determining an orientation of content displayed onthe screen of the electronic device;

after the user performs the first rotation operation on the electronicdevice, determining whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device; and

in response to that after the user performs the first rotation operationon the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintaining theorientation of the content displayed on the screen of the electronicdevice.

In the method and the apparatus for adjusting an orientation, and theelectronic device in the embodiments of this application, according towhether an orientation of a screen of an electronic device is consistentwith an orientation of content displayed on the screen of the electronicdevice after a user performs a first rotation operation on theelectronic device, the orientation of the content displayed on thescreen of the electronic device is flexibly adjusted. Content displayedon the electronic device can be adjusted to an orientation suitable fora user to view, and the user does not need to perform a specifiedgesture or enter an edit interface to perform a rotation operation,thereby simplifying a user operation and improving user experience.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a display interface of an electronicdevice when the electronic device changes from landscape to portrait ina traditional case;

FIG. 2 is a schematic diagram of a display interface of an electronicdevice when the electronic device changes from landscape to portrait inanother traditional case;

FIG. 3 is a schematic diagram showing that a user adjusts an orientationby using a gesture;

FIG. 4 is a flowchart of a method for adjusting an orientation accordingto an embodiment of this application;

FIG. 5 is a schematic diagram of a display interface of an electronicdevice when the electronic device changes from landscape to portrait ina method for adjusting an orientation is used according to an embodimentof this application;

FIG. 6 is a flowchart of a method for adjusting an orientation accordingto another embodiment of this application;

FIG. 7a is a flowchart of a method for adjusting an orientationaccording to another embodiment of this application;

FIG. 7b is a flowchart of a method for adjusting an orientationaccording to another embodiment of this application;

FIG. 8 is a schematic diagram showing that an electronic device rotatesaround a direction of the electronic device according to an embodimentof this application;

FIG. 9 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to an embodiment of this application;

FIG. 10 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to another embodiment of thisapplication;

FIG. 11 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to still another embodiment of thisapplication;

FIG. 12 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to still another embodiment of thisapplication; and

FIG. 13 is a schematic structural diagram of an electronic deviceaccording to an embodiment of this application.

DETAILED DESCRIPTION

Specific implementation manners of the present application are furtherdescribed in detail with reference to accompanying drawings andembodiments. The following embodiments are used to describe thisapplication, but are not intended to limit the scope of thisapplication.

A person skilled in the art understands that sequence numbers of thefollowing steps do not mean execution sequences in embodiments of thisapplication. The execution sequences of the steps should be determinedaccording to functions and internal logic of the steps, and should notbe construed as any limitation on the implementation processes of theembodiments of this application.

Moreover, terminologies such as “first” and “second” in this applicationare used only to distinguish different steps, devices, modules, and thelike; and indicate neither a particular technical meaning nor aninevitable logical sequence thereof.

FIG. 4 is a flowchart of a method for adjusting an orientation accordingto an embodiment of this application, wherein the method may beimplemented on, for example, an electronic device. As shown in FIG. 4,the method may comprise:

S100: In response to a first rotation operation performed by a user onan electronic device, determine an orientation of content displayed onthe screen of the electronic device.

S120: After the user performs the first rotation operation on theelectronic device, determine whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device.

S140: In response to that after the user performs the first rotationoperation on the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintain theorientation of the content displayed on the screen of the electronicdevice.

In the method for adjusting an orientation in this embodiment of thisapplication, according to whether an orientation of a screen of anelectronic device is consistent with an orientation of content displayedon the screen of the electronic device after a user performs a firstrotation operation on the electronic device, the orientation of thecontent displayed on the screen of the electronic device is flexiblyadjusted. Content displayed on the electronic device can be adjusted toan orientation suitable for a user to view, and the user does not needto perform a specified gesture or enter an edit interface to perform arotation operation, thereby simplifying a user operation and improvinguser experience.

In the example of the scenario shown in FIG. 2, after the electronicdevice rotates, the content displayed on the screen of the electronicdevice also correspondingly rotates. In a traditional solution,regardless of how the electronic device is rotated, an orientation ofdisplayed content is unsuitable for a user. However, by using the methodfor adjusting an orientation in this embodiment of this application,after a user rotates the screen of the electronic device, the contentdisplayed on the screen of the electronic device is temporarily notrotated, and when it is determined that the orientation of the screen ofthe rotated electronic device is consistent with the originalorientation of the content, the content displayed on the screen does notneed to be rotated, which finally improves user experience, as shown inFIG. 5.

Exemplarily, in this embodiment of this application, the electronicdevice comprises but is not limited to: a mobile phone, a personaldigital assistant (Full name in English: Personal Digital Assistant, PDAfor short), a tablet computer, and the like.

Optionally, as shown in FIG. 6, after S120, the method may furthercomprise:

S160: In response to that after the user performs the first rotationoperation on the electronic device, the orientation of the screen of theelectronic device is inconsistent with the orientation of the contentdisplayed on the screen of the electronic device, perform a secondrotation operation on the content displayed on the screen of theelectronic device.

In an optional implementation manner, a direction of the first rotationoperation may be contrary to a direction of the second rotationoperation. For example, a user rotates the electronic device by 90degrees counterclockwise in the first rotation operation, and discoversthat content displayed on the electronic device is not adjusted to anorientation suitable for watching as expected; therefore, the secondrotation operation may be performed on the content displayed on thescreen of the electronic device, for example, the content displayed onthe screen of the electronic device is rotated by 90 degrees clockwise,or rotated by 180 degrees clockwise, or rotated by 270 degreesclockwise.

Certainly, this embodiment of this application is not limited to thiscase. In another optional implementation manner, alternatively, thedirection of the first rotation operation may be the same as thedirection of the second rotation operation. For example, a user rotatesthe electronic device by 90 degrees counterclockwise in the firstrotation operation, and discovers that content displayed on theelectronic device is not adjusted to an orientation suitable forwatching as expected; therefore, the second rotation operation may beperformed on the content displayed on the screen of the electronicdevice, for example, the content displayed on the screen of theelectronic device is rotated by 90 degrees counterclockwise, or rotatedby 180 degrees counterclockwise, or rotated by 270 degreescounterclockwise.

As shown in FIG. 7a , in another optional implementation manner of thisapplication, the determining an orientation of content displayed on thescreen of the electronic device in S100 may comprise:

S100-A: According to a characteristic of the content displayed on thescreen of the electronic device, determine the orientation of thecontent displayed on the screen of the electronic device.

Exemplarily, a characteristic of at least a part of the contentdisplayed on the screen of the electronic device may be extracted, andthe orientation of the content displayed on the screen of the electronicdevice is determined according to the extracted characteristic.

For example, if the content displayed on the screen of the electronicdevice is a picture of a person, the picture of the person or a part ofthe picture of the person may be processed and analyzed, to extract acharacteristic area or a characteristic point, to recognize anorientation of the picture of the person. For example, it may bedetermined whether the picture of the person is longitudinal ortransverse according to a line that connects the two eyes of the pictureof the person, and a position of the nose of the picture of the person.

As shown in FIG. 7b , in another optional implementation manner of thisapplication, the determining an orientation of content displayed on thescreen of the electronic device in S100 may comprise:

S100-B: According to an identifier of the orientation of the contentdisplayed on the screen of the electronic device, determine theorientation of the content displayed on the screen of the electronicdevice.

Exemplarily, when acquiring content (for example, taking a photo orrecording a video) with cameras, some electronic devices may record anorientation of the content by using one or more identifiers; and anorientation of the content displayed on the screen of the electronicdevice may be determined subsequently according to the orientationidentifiers as needed.

For example, a reference direction may be determined in advance, forexample, may be a longitudinal direction, and the orientation identifiermay comprise information such as “an included angle between thereference direction and the orientation of the content in a clockwisedirection or in a counterclockwise direction”, as shown in Table 1.

TABLE 1 Rotation operation Orientation Included angle between areference identifier Direction direction and content Identifier 1Counterclockwise 180 degrees  Identifier 2 Counterclockwise 90 degreesIdentifier 3 Clockwise 90 degrees

In an actual application, a variation range between −α and +α may beallowed for the included angle, for example, the included angle isactually 80 degrees in a clockwise direction, however, if an error of 10degrees is within the allowed variation range, it can still beconsidered that an orientation identifier corresponds to the identifier3. α may be a default value, or may be set according to an actual case.If an error within a relatively large range can be tolerated, α may beset to a slightly large value, for example, ±10 degrees; and if arequirement on preciseness is relatively high, α may be set to aslightly small value, for example, ±5 degrees, or may even be set to 0degree.

Optionally, in an embodiment of this application, a position of theelectronic device may be detected according to a sensor in theelectronic device. For example, as shown in FIG. 8, if it is detectedthat the electronic device rotates around a normal direction (normaldirection) of the electronic device, it may be determined that a userperforms the first rotation operation on the electronic device.

Exemplarily, the sensor comprises but is not limited to: a gravityacceleration sensor or a camera (Camera).

FIG. 9 is a schematic structural diagram of modules of an apparatus foradjusting an orientation according to an embodiment of this application.The apparatus for adjusting an orientation may be an electronic devicesuch as a mobile phone, a PDA, a tablet computer, or a camera, or may beone or more chips, a partial circuit, or one or more functional modulesin an electronic device. As shown in FIG. 9, the apparatus 900 foradjusting an orientation may comprise:

a first determining module 910, configured to: in response to a firstrotation operation performed by a user on an electronic device,determine an orientation of content displayed on the screen of theelectronic device;

a second determining module 920, configured to: after the user performsthe first rotation operation on the electronic device, determine whetheran orientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice; and

a first adjustment module 930, configured to: in response to that afterthe user performs the first rotation operation on the electronic device,the orientation of the screen of the electronic device is consistentwith the orientation of the content displayed on the screen of theelectronic device, maintain the orientation of the content displayed onthe screen of the electronic device.

In the apparatus for adjusting an orientation in this embodiment of thisapplication, according to whether an orientation of a screen of anelectronic device is consistent with an orientation of content displayedon the screen of the electronic device after a user performs a firstrotation operation on the electronic device, the orientation of thecontent displayed on the screen of the electronic device is flexiblyadjusted. Content displayed on the electronic device can be adjusted toan orientation suitable for a user to view, and the user does not needto perform a specified gesture or enter an edit interface to perform arotation operation, thereby simplifying a user operation and improvinguser experience.

Referring to FIG. 10, in an optional implementation manner, theapparatus 900 for adjusting an orientation may further comprise:

a second adjustment module 940, configured to: in response to that afterthe user performs the first rotation operation on the electronic device,the orientation of the screen of the electronic device is inconsistentwith the orientation of the content displayed on the screen of theelectronic device, perform a second rotation operation on the contentdisplayed on the screen of the electronic device.

In an optional implementation manner, as shown in FIG. 11, the firstdetermining module 910 may further comprise:

a first determining unit 911, configured to: according to acharacteristic of the content displayed on the screen of the electronicdevice, determine the orientation of the content displayed on the screenof the electronic device; and/or

a second determining unit 912, configured to: according to an identifierof the orientation of the content displayed on the screen of theelectronic device, determine the orientation of the content displayed onthe screen of the electronic device.

Referring to FIG. 12, in an optional implementation manner, theapparatus 900 for adjusting an orientation may further comprise:

a sensing module 950, configured to detect a position of the electronicdevice; and

a transmission module 960, configured to: in response to that it isdetected that the electronic device rotates around a normal direction(normal direction) of the electronic device, transmit a detection resultto the first determining module 910.

Optionally, the sensor 950 may comprise a gravity acceleration sensor ora camera.

Referring to FIG. 13, another embodiment of this application provides anelectronic device 1300. Referring to FIG. 13, the electronic device 1300may comprise:

a processor (processor) 1310 and a memory (memory) 1330.

The memory 1330 is configured to store an instruction, and the processor1310 is configured to execute the instruction, to perform the followingsteps:

in response to a first rotation operation performed by a user on anelectronic device, determining an orientation of content displayed onthe screen of the electronic device;

after the user performs the first rotation operation on the electronicdevice, determining whether an orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device; and

in response to that after the user performs the first rotation operationon the electronic device, the orientation of the screen of theelectronic device is consistent with the orientation of the contentdisplayed on the screen of the electronic device, maintaining theorientation of the content displayed on the screen of the electronicdevice.

It may be clearly understood by a person skilled in the art that, forthe purpose of a convenient and brief description, for specific workingprocesses of the apparatus for adjusting an orientation and theelectronic device described above, reference may be made tocorresponding process descriptions in the method for adjusting anorientation in the foregoing method embodiment, which are not describedherein again.

In conclusion, by using the electronic device in this embodiment of thisapplication, according to whether an orientation of a screen of anelectronic device is consistent with an orientation of content displayedon the screen of the electronic device after a user performs a firstrotation operation on the electronic device, the orientation of thecontent displayed on the screen of the electronic device is flexiblyadjusted. Content displayed on the electronic device can be adjusted toan orientation suitable for a user to view, and the user does not needto perform a specified gesture or enter an edit interface to perform arotation operation, thereby simplifying a user operation and improvinguser experience.

A person of ordinary skill in the art may be aware that, the exemplaryunits and method steps described in the embodiments disclosed in thisspecification may be implemented by electronic hardware, or acombination of computer software and the electronic hardware. Whetherthe functions are performed by hardware or software depends onparticular applications and design constraint conditions of thetechnical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but the implementation should not be construed as exceedingthe scope of the present application.

When the functions are implemented in a form of a software functionalunit, and are sold or used as an independent product, the functions maybe stored in a computer readable storage medium. Based on such anunderstanding, the technical solutions of this application essentially,or the part contributing to the prior art, or a part of the technicalsolutions may be implemented in a form of a software product. Thecomputer software product is stored in a storage medium and comprisesseveral instructions for instructing a computer device (which may be apersonal computer, a controller, a network device, or the like) toperform all or a part of the steps of the method described in theembodiment of this application. The foregoing storage medium comprisesany medium that can store program code, such as a USB flash drive, aremovable hard disk, a read-only memory (Read-Only Memory, ROM), arandom access memory (Random Access Memory, RAM), a magnetic disk, or anoptical disc.

The foregoing implementation manners are only used for describing thepresent application, and are not intended to limit the presentapplication. A person of ordinary skill in the art may make variouschanges and variations without departing from the spirit and scope ofthe present application; therefore, any equivalent technical solutionfalls within the scope of the present application, and patent protectionscope of the present application shall be defined by claims.

What is claimed is:
 1. A method for adjusting an orientation,comprising: in response to a first rotation operation performed by auser on an electronic device, determining an orientation of contentdisplayed on the screen of the electronic device; after the userperforms the first rotation operation on the electronic device,determining whether an orientation of the screen of the electronicdevice is consistent with the orientation of the content displayed onthe screen of the electronic device; and in response to that after theuser performs the first rotation operation on the electronic device, theorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice, maintaining the orientation of the content displayed on thescreen of the electronic device.
 2. The method of claim 1, wherein themethod further comprises: in response to that after the user performsthe first rotation operation on the electronic device, the orientationof the screen of the electronic device is inconsistent with theorientation of the content displayed on the screen of the electronicdevice, performing a second rotation operation on the content displayedon the screen of the electronic device.
 3. The method of claim 2,wherein a direction of the first rotation operation is the same as orcontrary to a direction of the second rotation operation.
 4. The methodaccording to claim 1, wherein the determining an orientation of contentdisplayed on the screen of the electronic device comprises: according toa characteristic of the content displayed on the screen of theelectronic device, determining the orientation of the content displayedon the screen of the electronic device.
 5. The method according to claim1, wherein the determining an orientation of content displayed on thescreen of the electronic device comprises: according to an identifier ofthe orientation of the content displayed on the screen of the electronicdevice, determining the orientation of the content displayed on thescreen of the electronic device.
 6. The method of claim 1, whereinbefore the determining an orientation of content displayed on the screenof the electronic device, the method further comprises: determining thatthe user performs the first rotation operation on the electronic device.7. The method of claim 6, wherein the determining that the user performsthe first rotation operation on the electronic device comprises:detecting, according to a sensor in the electronic device, that the userrotates the electronic device around a normal direction of theelectronic device, and determining that the user performs the firstrotation operation on the electronic device.
 8. The method of claim 7,wherein the sensor comprises: a gravity acceleration sensor or a camera.9. An apparatus for adjusting an orientation, comprising: a firstdetermining module, configured to: in response to a first rotationoperation performed by a user on an electronic device, determine anorientation of content displayed on the screen of the electronic device;a second determining module, configured to: after the user performs thefirst rotation operation on the electronic device, determine whether anorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice; and a first adjustment module, configured to: in response tothat after the user performs the first rotation operation on theelectronic device, the orientation of the screen of the electronicdevice is consistent with the orientation of the content displayed onthe screen of the electronic device, maintain the orientation of thecontent displayed on the screen of the electronic device.
 10. Theapparatus of claim 9, wherein the apparatus for adjusting an orientationfurther comprises: a second adjustment module, configured to: inresponse to that after the user performs the first rotation operation onthe electronic device, the orientation of the screen of the electronicdevice is inconsistent with the orientation of the content displayed onthe screen of the electronic device, perform a second rotation operationon the content displayed on the screen of the electronic device.
 11. Theapparatus of claim 9, wherein the first determining module comprises: afirst determining unit, configured to: according to a characteristic ofthe content displayed on the screen of the electronic device, determinethe orientation of the content displayed on the screen of the electronicdevice; and/or a second determining unit, configured to: according to anidentifier of the orientation of the content displayed on the screen ofthe electronic device, determine the orientation of the contentdisplayed on the screen of the electronic device.
 12. The apparatusaccording to claim 9, wherein the apparatus for adjusting an orientationfurther comprises: a sensing module, configured to detect a position ofthe electronic device; and a transmission module, configured to: inresponse to that it is detected that the electronic device rotatesaround a normal direction of the electronic device, transmit a detectionresult to the first determining module.
 13. The apparatus of claim 12,wherein the sensing module comprises: a gravity acceleration sensor or acamera.
 14. An electronic device, comprising a memory and a processor,wherein the memory is configured to store an instruction, and theprocessor is configured to execute the instruction, to perform thefollowing steps: in response to a first rotation operation performed bya user on an electronic device, determining an orientation of contentdisplayed on the screen of the electronic device; after the userperforms the first rotation operation on the electronic device,determining whether an orientation of the screen of the electronicdevice is consistent with the orientation of the content displayed onthe screen of the electronic device; and in response to that after theuser performs the first rotation operation on the electronic device, theorientation of the screen of the electronic device is consistent withthe orientation of the content displayed on the screen of the electronicdevice, maintaining the orientation of the content displayed on thescreen of the electronic device.